package com.tg.message.msg;

import android.os.Bundle;
import android.view.Window;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.base.BaseActivity;
import com.tange.base.toolkit.StatusBarUtil;
import com.tange.base.toolkit.StatusNavUtils;
import com.tg.message.R;

public class MessageActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_message_container);
        hideActionBar();
        MessageFragment fragment = MessageFragment.newInstance(getIntent().getExtras(), true);
        showFragment(fragment);
        StatusBarUtil.setStatusBarTransparent(this);
        StatusNavUtils.setStatusBarColor(this, getResources().getColor(com.module.commonui.R.color.white));
        StatusBarUtil.setLightStatusBar(this, true);
    }

    private void showFragment(Fragment fragment) {
        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        transaction.replace(R.id.child_container, fragment);
        transaction.commitNow();
    }

    @Override
    public boolean shouldSetStatusBarColor() {
        return true;
    }

    @Override
    protected int statusBarColor() {
        return getResources().getColor(com.module.commonui.R.color.white);
    }

    @Override
    protected void initView() { }
}
